package com.itheima;

import java.util.Random;

//借助随机数，创建一个从1995.1.1 00:00:00 到 1995.12.31 23:59:59 之间的随机日期
public class Date {
    public static void main(String[] args) {
        Random r = new Random();
        int month = r.nextInt(0,12);
        int day = 0;
        switch (month){
            case 1 -> { day = r.nextInt(0,31);}
            case 2 -> { day = r.nextInt(0,28);}
            case 3 -> { day = r.nextInt(0,31);}
            case 4 -> { day = r.nextInt(0,30);}
            case 5 -> { day = r.nextInt(0,31);}
            case 6 -> { day = r.nextInt(0,30);}
            case 7 -> { day = r.nextInt(0,31);}
            case 8 -> { day = r.nextInt(0,31);}
            case 9 -> { day = r.nextInt(0,30);}
            case 10 -> { day = r.nextInt(0,31);}
            case 11 -> { day = r.nextInt(0,30);}
            case 12 -> { day = r.nextInt(0,31);}
        }
        int time_hour = r.nextInt(0,23);
        int time_minuter = r.nextInt(0,59);
        int time_second = r.nextInt(0,59);
        System.out.println("日期为1995."+month+"."+day+" "+time_hour+":"+time_minuter+":"+time_second);
    }
}
